package org.jackysoft.controller;

import java.util.Collection;

import javax.annotation.Resource;

import org.jackysoft.controller.base.AbstractController;
import org.jackysoft.entity.OsRuntimeContext;
import org.jackysoft.service.OsRuntimeContextService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/oswf/runctx")
public class OsRuntimeContextController extends
		AbstractController<OsRuntimeContext> {

	@Resource
	private OsRuntimeContextService service;
	@ResponseBody
	@RequestMapping("/json")
	public OsRuntimeContext get(String refname,long stepId,int actionId) throws Exception {
		OsRuntimeContext bean = service.findOne(refname, actionId, stepId);
		return bean;
	}


	@RequestMapping("/findbyname")
	public void findbyname(
			String refname,
			@ModelAttribute Collection<OsRuntimeContext> beans
			
			) throws Exception {
		beans = service.getsByName(refname);
	}	

}
